package com.example.mingyue.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.mingyue.model.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
* @author 我自飞扬临天下
* @description 针对表【user(用户表)】的数据库操作Mapper
* @createDate 2025-01-09 12:05:05
* @Entity com.example.mingyue.model.entity.User
*/
@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("select * from user where openid = #{openid}")
    User newUserByOpenId(String openid);

    @Insert("insert into user(phone, username, openid, createTime, avatarUrl, gender)" +
            " values (#{phone},#{username},#{openid},#{createTime},#{avatarUrl},#{gender})")
    void addUser(User user1);

}




